import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:ball_lion/resources/colours.dart';
import 'package:ball_lion/utils/widget_utils.dart';
import 'package:ball_lion/widgets/ball_appbar.dart';
import 'package:get/get.dart';

import 'package:ball_lion/widgets/base/wqs_text.dart';

class MyDescEditPage extends StatefulWidget {
  const MyDescEditPage({super.key});

  @override
  State<MyDescEditPage> createState() => _MyDescEditPageState();
}

class _MyDescEditPageState extends State<MyDescEditPage> {
  final tec = TextEditingController();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colours.scaffoldBg,
      appBar: BallAppBar(
        title: "设置个性签名",
        actions: [
          const Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              QsText("完成",
                  color: Colours.main,
                  fontSize: 16,
                  fontWeight: FontWeight.w500),
            ],
          ).tap(() {}).marginOnly(right: 16)
        ],
      ),
      body: Column(
        children: [
          editor(),
          Container(
            alignment: Alignment.centerLeft,
            margin: const EdgeInsets.symmetric(horizontal: 20),
            child: QsText("请输入50个汉字或100个字符以内的内容",
                color: Colours.grey99, fontSize: 12),
          ),
        ],
      ),
    );
  }

  Widget editor() => Container(
        margin: const EdgeInsets.all(8),
        padding: const EdgeInsets.all(12),
        decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(8), color: Colors.white),
        child: CupertinoTextField(
          decoration: BoxDecoration(
              border: Border.all(width: 0, style: BorderStyle.none)),
          controller: tec,
          maxLength: 50,
          maxLines: 2,
        ),
      );
}
